<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <!-- 最大升序子数组和 -->
    <script>
      var max = function (nums) {
        let res = 0
        let l = 0
        while (l < nums.length) {
          let cursum = nums[l++]
          while (l < nums.length && nums[l] > nums[l - 1]) {
            cursum += nums[l++]
          }
          res = Math.max(res, cursum)
        }
        return res
      }
      // console.log(max([10, 20, 30, 5, 10, 50]))
      // console.log(max([10, 20, 30, 40, 50]))
      // console.log(max([12, 17, 15, 13, 10, 11, 12]))
      console.log(max([100, 10, 1]))
    </script>
  </body>
</html>
